/*
* Figure 1: Descriptive Ownership and WWII Veterans by Birth Year * 
* Figure 2: Racial Representation among HLG Recipients and in Military *

*/

matrix drop _all
macro drop _all 
	
global dir = "YourFilePath"
global output = "$dir"
global working_data = "$dir/ipums60_pub.dta"

cd "$output"
use "$working_data", clear

set more off
set scheme plotplain

********************************************************************************
* Figure 1: Descriptive Ownership and WWII Veterans by Birth Year * 
********************************************************************************
* Figure 1a: % veterans by birth cohort *
graph twoway scatter pvetwwii yob if yob >= 1912 & yob <= 1932, ///
	title("A. %Veterans by Birth Cohort (1960)") xlabel(1912(3)1932) ///
	ylabel(0(10)100) ytitle("%") xtitle("Birth Cohort")  xline(1917 1927)  name(vets_yob, replace)
	
* Figure 1b: % homeowners by birth cohort* 
graph twoway scatter pown_yob_1960 yob if yob >= 1912 & yob <= 1932, ///
	title("B. %Homeowners by Birth Cohort (1960)") xlabel(1912(3)1932) ///
	ylabel(0(10)100) ytitle("%") xtitle("Birth Cohort")  xline(1917 1927) name(owners_yob, replace)
		

graph combine vets_yob owners_yob , rows(1) 
graph export "fig1_owners_vets_yob.png", //replace

********************************************************************************
* Figure 2: Racial Representation among HLG Recipients and in Military *
********************************************************************************	
global working_data = "$dir/fig2_hlg_military_avg.dta"
use "$working_data", clear

graph twoway (bar white_military xaxis if xaxis == 1, color(eltgreen) barw(0.9)) ///
	(bar avg_pwhite_hlg xaxis if xaxis == 2, color(eltgreen) barw(0.9)) ///
	(bar black_military xaxis if xaxis == 3, color(lavender) barw(0.9)) ///
	(bar avg_pblack_hlg xaxis if xaxis == 4, color(lavender) barw(0.9)) ///
	(scatter toscatter xaxis if xaxis<5, mlabel(toscatter) msymbol(none) mlabposition(12) mlabsize(medium)), ///
	ylabel(0(10)100, labsize(medium)) xlabel(1 "Military" 2"HLG Loans" 3 "Military" 4"HLG Loans", noticks labsize(medium)) ///
	ytitle(Percent, size(medium)) xtitle("") legend(off)
		
graph export "fig2_hlg_military.png", //replace
		
		